home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #2 / Ham Radio 2000 - Volume 2.iso / HAMV2 / TCP_IP / TNOS230S / AUTHOR.C < prev    next >
Encoding:
C/C++ Source or Header  |  1996-12-23  |  2.4 KB  |  112 lines

  1. #ifdef MSDOS
  2. #include <stdio.h>
  3. #include <dir.h>
  4. #include <dos.h>
  5. #include <string.h>
  6. #include <time.h>
  7. #define TUTOR        1
  8. #define STANDALONE    1
  9. #define ASCII_TYPE     0
  10. #define tprintf printf
  11. #define NULLCHAR ((char *) 0)
  12. #define NULLFILE ((FILE *) 0)
  13. #define READ_TEXT "rt"
  14.  
  15. #if !defined(_lint)
  16. static char rcsid[] OPTIONAL = "$Id: author.c,v 1.8 1996/12/23 22:44:37 root Exp root $";
  17. #endif
  18.  
  19. char *Info, *Tutor, *News, *Hostname;
  20.  
  21. kwait (void * i) {}
  22.  
  23. tputs (char *str)
  24. {
  25.     fputs (str, stdout);
  26. }
  27.  
  28. tputc (char c)
  29. {
  30.     putchar (c);
  31. }
  32.  
  33. void
  34. mygets (buf, size, here)
  35. char *buf;
  36. int size;
  37. struct world *here;
  38. {
  39.     fgets(buf, size, stdin);
  40. }
  41.  
  42. rdaemon (FILE *out, char *replyto, char *from, char *to, char *subject, char msgtype)
  43. {
  44.     puts ("------------------------------------------------------");
  45.     puts ("On a TNOS system, a mail message WOULD have been sent\nat this point:\n");
  46.     printf ("  From: %s\n  To: %s\n  Reply-to: %s\n  Subject: %s\n  X-BBS-Msg-Type: %c\n", from, to, replyto, subject, msgtype);
  47.     puts ("------------------------------------------------------");
  48. }
  49.  
  50. /* replace terminating end of line marker(s) with null */
  51. void
  52. rip(s)
  53. register char *s;
  54. {
  55.     register char *cp;
  56.  
  57.     if((cp = strchr(s,'\n')) != NULLCHAR)
  58.         *cp = '\0';
  59. }
  60.  
  61. sendfile (FILE *fp)
  62. {
  63. int c;
  64.     while((c = getc(fp)) != EOF){
  65.         if(putchar((char)c) == -1)
  66.             break;
  67.     }
  68. }
  69.  
  70. #include "tutor.c"
  71. #define DEMO
  72. #include "color.c"
  73.  
  74. void
  75. main(int argc, char *argv[])
  76. {
  77. char selection[10];
  78. int select;
  79. char *call;
  80.  
  81.     Info = "INFO";
  82.     Tutor = "TUTOR";
  83.     News = "NEWS";
  84.     Hostname = "test.ampr.org";
  85.     call = "N4WOW";
  86.  
  87.     puts ("\nThe TNOS Information Server Authoring System assumes that you have\nthe following sub-directories in your current directory:\n");
  88.     puts ("   INFO, TUTOR, NEWS\n\nIf these do not exist in your current directory, don't blame me!    KO4KS\n");
  89.     for ( ; ; )    {
  90.         puts ("\nPick an information server...\n");
  91.         puts ("     0 - Exit the Authoring System");
  92.         puts ("     1 - Learning Center (TUTOR)");
  93.         puts ("     2 - Information Center (INFO)");
  94.         puts ("     3 - News Center (NEWS)");
  95.         do    {
  96.             puts ("\nEnter Selection:");
  97.             gets (selection);
  98.             select = atoi (selection);
  99.             if (!select)
  100.                 break;
  101.             if (select > 3)
  102.                 puts ("Invalid number... select 0 - 3!\007");
  103.         } while (select > 3);
  104.         if (!select)
  105.             break;
  106.         tutorserv (call, select - 1, 1, 1);
  107.         puts ("\n\n");
  108.     }
  109. }
  110. #endif /* MSDOS */
  111.  
  112.